package com.hh.gen;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 基础异常
 *
 * @author auto
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 所属模块
     */
    private String module;

    /**
     * 错误码对应的参数
     */
    private String message;

    /**
     * 错误消息
     */
    private String defaultMessage;

    public BaseException(String module, String message, String defaultMessage) {
        this.module = module;
        this.message = message;
        this.defaultMessage = defaultMessage;
    }

    public BaseException(String module, String message) {
        this(module, message, null);
    }

    public BaseException(String message) {
        this(null, message, null);
    }


    @Override
    public String getMessage() {
        return this.message;
    }

}
